package com.yiduo.outpost.stream.controller;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import com.yiduo.outpost.stream.sender.KafkaProducer;

/**
 * @Author yanwen
 * @create 2023/12/13 11:15
 */
@Slf4j
@RestController
@Tag(name = "kafka demo")
@RequestMapping("kafka")
public class KafkaController {

    @Autowired
    private KafkaProducer kafkaProducer;
    /**
     * test send message
     */
    @Operation(summary = "test send message")
    @RequestMapping(value = "test",method = {RequestMethod.POST})
    public void test(){
        kafkaProducer.sendMessage("test");
       log.info("test");
    }
}
